<template>
	<view class="bodycont">
		<u-form :model="form" ref="uForm" label-position="top">
			<u-form-item label="反馈标题:">
				<u-input v-model="form.title" />
			</u-form-item>
			<u-form-item label="反馈内容:">
				<u-input type="textarea" v-model="form.content"  />
			</u-form-item>
			
		</u-form>
		<u-button type="primary" style="margin-top: 30rpx;" @click="submit">提交</u-button>
	</view>
</template>

<script>
	import {
		API_URL
	} from '@/env.js'
	export default {
		data() {
			return {
			
				form: {
					content: '',
					title: ''
				},
				action: API_URL + '/addons/hicity/index/upload',
				imglist: [],
			};
		},
		methods: {
			imgRemove(index, lists, name) {
				let banner = [];
				lists.map((item) => {
					banner.push(item.response.data.url);
				})
				if (banner.length > 0) {
					this.form.images = banner.join(',');
				} else {
					this.form.images = '';
				}
			},
			imgSuccess(data, index, lists, name) {
				let banner = [];
				lists.map((item) => {
					banner.push(item.response.data.url);
				})
				if (banner.length > 0) {
					this.form.images = banner.join(',');
				}
			},
			submit() {
				if(this.form.title==''){
					return this.$u.toast('请输入标题');
				}
				if(this.form.content==''){
					return this.$u.toast('请填写反馈描述');
				}
				uni.showLoading({
					title:'提交中'
				})
				this.$u.post('/api/help/add_opinion', this.form).then(res => {
					uni.hideLoading();
					this.$u.toast('提交成功');
					setTimeout(()=>{
						uni.navigateBack({
							
						})
					},1500)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.bodycont {
		padding: 30rpx 20rpx;
		background-color: white;
	}
</style>
